package com.redsoft.spirit.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import com.redsoft.spirit.entity.ComCodeTable;

/**
 * 码表DAO
 * 
 * <pre>
 * 码表DAO
 * </pre>
 * 
 * @author 李晓东
 * @since 1.0
 */
public interface ComCodeTableRepository extends BaseRepository<ComCodeTable, String> {

	ComCodeTable findByInnerName(String innerName);
	
	List<ComCodeTable> findByParentIdAndItemValueIsNull(String parentId);

	List<ComCodeTable> findByItemLevel(int i);

	@Query(" from ComCodeTable cct where cct.parentId = :parentId order by cct.displayOrder asc")
	List<ComCodeTable> findByParentId(@Param("parentId")String parentId);

	ComCodeTable findById(String id);
	
}
